<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- set parent pom to taskmanager pom -->
  <parent>
    <groupId>org.geoserver.community</groupId>
    <artifactId>gs-taskmanager</artifactId>
    <version>2.26-SNAPSHOT</version>
  </parent>

  <groupId>org.geoserver.community</groupId>
  <artifactId>gs-taskmanager-core</artifactId>
  <packaging>jar</packaging>

  <name>GeoServer Task Manager Core</name>
  <description>GeoServer Task Manager

        Setup of the source DB . Usage:
        mvn db:schema -Ptestsourcedb

        Setup of the target DB . Usage:
        mvn db:schema -Ptesttargetdb</description>

  <dependencies>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-gwc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.geowebcache</groupId>
      <artifactId>gwc-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context-support</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>5.3.20.Final</version>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.19.0-GA</version>
    </dependency>
    <dependency>
      <groupId>org.quartz-scheduler</groupId>
      <artifactId>quartz</artifactId>
      <version>2.3.2</version>
    </dependency>
    <dependency>
      <groupId>com.sun.mail</groupId>
      <artifactId>jakarta.mail</artifactId>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream-hibernate</artifactId>
      <version>1.4.10</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>${log4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools.jdbc</groupId>
      <artifactId>gt-jdbc-postgis</artifactId>
    </dependency>
    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.persistence</groupId>
      <artifactId>javax.persistence-api</artifactId>
      <version>2.2</version>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-main</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-core</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>simple-jndi</groupId>
      <artifactId>simple-jndi</artifactId>
      <version>0.11.4.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-app-schema</artifactId>
      <version>${gt.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools.schemas</groupId>
      <artifactId>geosciml-2.0</artifactId>
      <version>2.0.2-4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>testsourcedb</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.googlecode</groupId>
            <artifactId>maven-db-plugin</artifactId>
            <version>1.3</version>
            <dependencies>
              <!--Choose the driver version of your postgres installation: 8.1-407.jdbc3/8.1-407.jdbc4-->
              <dependency>
                <groupId>postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>8.1-407.jdbc3</version>
              </dependency>
            </dependencies>
            <configuration>
              <adminDbConnectionSettings>
                <jdbcDriver>org.postgresql.Driver</jdbcDriver>
                <jdbcUrl>jdbc:postgresql://localhost:5432/testsourcedb</jdbcUrl>
                <userName>postgres</userName>
                <password>postgres</password>
              </adminDbConnectionSettings>
              <appDbConnectionSettings>
                <jdbcDriver>org.postgresql.Driver</jdbcDriver>
                <jdbcUrl>jdbc:postgresql://localhost:5432/testsourcedb</jdbcUrl>
                <userName>postgres</userName>
                <password>postgres</password>
              </appDbConnectionSettings>
              <sqlDelimiter>#-;</sqlDelimiter>
              <useBatch>false</useBatch>
              <dbSchemaScriptsDirectory>
                <param>src/test/resources/postgres/sourcedb</param>
              </dbSchemaScriptsDirectory>
              <dbCreateStatements>
                <!--schema creation is put in the sql script-->
              </dbCreateStatements>
              <dbDropStatements>

              </dbDropStatements>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>testtargetdb</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.googlecode</groupId>
            <artifactId>maven-db-plugin</artifactId>
            <version>1.3</version>
            <dependencies>
              <!--Choose the driver version of your postgres installation: 8.1-407.jdbc3/8.1-407.jdbc4-->
              <dependency>
                <groupId>postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>8.1-407.jdbc3</version>
              </dependency>
            </dependencies>
            <configuration>
              <adminDbConnectionSettings>
                <jdbcDriver>org.postgresql.Driver</jdbcDriver>
                <jdbcUrl>jdbc:postgresql://localhost:5432/testtargetdb</jdbcUrl>
                <userName>postgres</userName>
                <password>postgres</password>
              </adminDbConnectionSettings>
              <appDbConnectionSettings>
                <jdbcDriver>org.postgresql.Driver</jdbcDriver>
                <jdbcUrl>jdbc:postgresql://localhost:5432/testtargetdb</jdbcUrl>
                <userName>postgres</userName>
                <password>postgres</password>
              </appDbConnectionSettings>
              <sqlDelimiter>#-;</sqlDelimiter>
              <useBatch>false</useBatch>
              <dbSchemaScriptsDirectory>
                <param>src/test/resources/postgres/targetdb</param>
              </dbSchemaScriptsDirectory>
              <dbCreateStatements>

              </dbCreateStatements>
              <dbDropStatements>

              </dbDropStatements>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
